﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Text;
using System.Net;

using LRSTaxServices.Biz;

public partial class LRSClientSupport : System.Web.UI.Page
{
    #region Public Properties

    public ClientSupport clientobj;

    #endregion

    #region Event Handlers

    #region Page Load

    protected void Page_Load(object sender, EventArgs evt)
    {
        if (!Page.IsPostBack)
        {
            //InitMaxFieldLengths();
        }
    }

    #endregion

    #region Submit Click Event

    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        clientobj = ClientSupport.CreateNew();
        clientobj.FirstName = txtfname.Text;
        clientobj.LastName = txtlname.Text;
        clientobj.EmailAddress = txtemail.Text;
        clientobj.ContactPhone = txtphone.Text;
        clientobj.Question = txtquestion.Text;
        ClientSupport.Update(clientobj);

        string emailfeedback;
        bool emailsend = LRSTaxServices.MailUtils.SendEmail(txtemail.Text, "admin", "Client Support", "Your Question has been successfully posted to LRS.We will contact you soon. <br><br> This is an auto generated mail,please do not reply.", out emailfeedback);

        string emailfeedback1;
        bool emailsend1 = LRSTaxServices.MailUtils.SendEmail("sachin.verma@vermasoftech.com", "admin", "Client Support", "A question has been posted by Mr./Mrs. " + txtfname.Text + " " + txtlname.Text + " with following details :.<br><br> Name : " + txtfname.Text + " " + txtlname.Text + " <br> Email : " + txtemail.Text + " <br> Phone : " + txtphone.Text + " <br> Question : "+txtquestion.Text+"<br><br> This is an auto generated mail,please do not reply.", out emailfeedback1);
    }

    #endregion

    #endregion    
}
